﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;

namespace Aandelendelen.Payment
{
	public class Consumer
	{
		string name;
		string account;
		string city;
		string custom = "";

		public Consumer(XmlNode consumerNode)
		{
			foreach (XmlNode childNode in consumerNode)
			{
				switch (childNode.Name.ToLower())
				{
					case "consumername":
						this.name = childNode.InnerText;
						break;
					case "consumeraccount":
						this.account = childNode.InnerText;
						break;
					case "consumercity":
						this.city = childNode.InnerText;
						break;
					default: this.custom += childNode.OuterXml;
						break;
				}
			}
		}

		public string Name
		{
			get { return this.name; }
		}

		public string Account
		{
			get { return this.account; }
		}

		public string City
		{
			get { return this.city; }
		}

		public string Custom
		{
			get { return this.custom; }
		}

	}
}